Base32 Encode
Base32 encoder with support for multiple variants.
Installation
npm install --save base32-encode
Usage
const base32Encode = require('base32-encode')
const data = new Uint8Array([0x74, 0x65, 0x73, 0x74])
console.log(base32Encode(data, 'Crockford'))
console.log(base32Encode(data, 'RFC4648'))
console.log(base32Encode(data, 'RFC4648', { padding: false }))
console.log(base32Encode(data, 'RFC4648-HEX'))
API
base32Encode(data, variant, options)
data
<ArrayBuffer | Int8Array | Uint8Array | Uint8ClampedArray>variant
<String>options
<Object>
Encode the data in data
. variant
should be one of the supported variants
listed below.
Options may have a padding
property which provides a way to forcefully enable or disable padding. The default behavior is to follow the default of the selected variant.
See also